package com.factory._01simple;

import com.factory._01simple.inter.Fruit;

/**
 *  简单工厂模式
 */
public class FactoryTest {
    public static void main(String[] args) {
       try{
           Fruit grape = FruitGardener.factory("grape");
           grape.grow();
           grape.harvest();
           grape.harvest();

           Fruit apple = FruitGardener.factory("apple");
           apple.grow();
           apple.harvest();
           apple.harvest();
           Fruit strawberry = FruitGardener.factory("strawberry");
           strawberry.grow();
           strawberry.harvest();
           strawberry.harvest();
       }catch(Exception exception){
           System.out.println(exception);

       }
    }
}
